{% extends "AUTH/navbar.html" %}
{% block title %}<title>修改密码</title>{% endblock %}
{% block content %}
    <div class="container">
        {% if ok == 1 %}
            <div class="alert alert-success text-center" role="alert">
                <button type="button" class="close" data-dismiss="alert"><span class="glyphicon glyphicon-remove"></span></button>
                <strong>您的密码修改成功！</strong>
            </div>
        {% endif %}
        <h1>修改密码

        </h1>
        <div class="row">
            <div class="col-sm-6 col-sm-offset-4 col-md-5 col-md-offset-4 col-lg-4 col-lg-offset-4">
                <div class="login center-block">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><strong>修改密码</strong></h3>
                        </div>
                        <div class="panel-body">
                            <form action='.' method='post'>
                                {% csrf_token %}
                                {% if form.errors %}
                                    <p class="alert alert-danger">
                                        <span class="glyphicon glyphicon-alert"></span>
                                        {% if form.errors.items|length == 1 %}&#12288;&#12288; 输入有误，请重新输入！
                                        {% else %} &#12288;&#12288;输入有误，请重新输入！
                                        {% endif %}
                                    </p>
                                {% endif %}
                                <div class="form-group">
                                    {{ form.old_password.errors }}
                                    <strong>输入旧密码:&#12288;&#12288;</strong>
                                    {{ form.old_password }}
                                </div>
                                <div class="form-group">
                                    {{ form.new_password1.errors }}
                                    <strong>输入新密码:&#12288;&#12288;</strong>
                                    {{ form.new_password1 }}
                                    {% if form.new_password1.help_text %}
                                        <p class="alert-warning">{{ form.new_password1.help_text }}</p>
                                    {% endif %}
                                </div>
                                <div class="form-group">
                                    {{ form.new_password2.errors }}
                                    <strong>确认新密码:&#12288;&#12288;</strong>
                                    {{ form.new_password2 }}
                                    {% if form.new_password2.help_text %}
                                        <p class="alert-warning">{{ form.new_password2.help_text }}</p>
                                    {% endif %}
                                </div>
                                <div class="btn-group-justified" role="group">
                                    <div class="btn-group" role="group">
                                        <button type="submit" class="btn btn-default"><strong>修  改</strong></button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
